package edu.whu.demo.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import edu.whu.demo.domain.Activity;
import org.apache.ibatis.annotations.*;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 
 * @since 2022-11-24
 */
@Mapper
public interface ActivityDao extends BaseMapper<Activity> {
    @Select(
        "select distinct a.* from activity a left join user u on a.host_uid=u.uid "
            + "${ew.customSqlSegment}")
    IPage<Activity> findActivity(IPage<Activity> page, @Param(Constants.WRAPPER)QueryWrapper<Activity> wrapper);

    @Select("select name from activity where id=#{id}")
    String findNameById(Long id);

    @Select("select pic1 from activity where id=#{id}")
    String findPic1ById(Long id);


}
